package triangle;
import java.util.*;
public class Point {

	private double abscissa;
	private double ordinate;

	public Point(){
		abscissa=0;
		ordinate=0;
	}
	
	public Point(double a,double b){
		this.abscissa=a;
		this.ordinate=b;
		
	}
	
	public void input(){
		Scanner kb= new Scanner(System.in);
		System.out.println("enter abscisa:");
		abscissa= kb.nextDouble();
		System.out.println("enter ordinate:");
		ordinate= kb.nextDouble();
	}
	
	public void output(){
		System.out.println("("+abscissa+";"+ordinate+")");
	}
	
	public double comDistance( Point b){
		return(Math.sqrt((Math.pow(abscissa-b.abscissa, 2))+Math.pow(ordinate-b.ordinate, 2)));
	}
	
	public double areaTriangle(Point b,Point c){
		double s,p;
		p=(comDistance(b)+b.comDistance(this)+b.comDistance(c))/2;
		s=Math.sqrt(p*(p-comDistance(b))*(p-b.comDistance(this))*(p-b.comDistance(c)));
		return s;
	}
	
	
	

	
	
}
